<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>FreeCDN CoreLib Test</title>
  <meta id="referrerMeta" name="referrer" content="default">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="libs/mocha.css">
  <script src="libs/mocha.js"></script>
  <script src="libs/chai.js"></script>
  <script src="freecdn.js"></script>
</head>
<body>
  <div id="mocha"></div>
  <script class="mocha-init">
    mocha.setup('bdd')
    mocha.checkLeaks()
  </script>
  <script>
    function sleep(ms) {
      return new Promise(f => setTimeout(f, ms))
    }
    function base64Encode(bytes) {
      const asc = bytes.reduce((s, v) => s + String.fromCharCode(v), '')
      return btoa(asc)
    }
    function strToBytes(str) {
      return new TextEncoder().encode(str)
    }
    function randBytes(len, seed) {
      const buf = new Uint8Array(len)
      let key = ~seed
      for (let i = 0; i < len; i++) {
        key *= 31
        buf[i] = key
      }
      return buf
    }
  </script>
  <script src="test.weight.js"></script>
  <script src="test.basic.js"></script>
  <script src="test.config.js"></script>
  <script src="test.params.js"></script>
  <script class="mocha-exec">
    const {expect} = chai
    mocha.run()
  </script>
</body>
</html>